@* Copyright (c) Kurrent, Inc and/or licensed to Kurrent, Inc under one or more agreements. *@
@* Kurrent, Inc licenses this file to you under the Kurrent License v1 (see LICENSE.md). *@

@page "/ui/plugins"
@rendermode InteractiveServer
@attribute [Authorize]
@using EventStore.Plugins
@using Microsoft.AspNetCore.Authorization
@inherits KurrentDB.Components.Licensed.LicensedPage
@inject PluginsService PluginsService

<MudDataGrid Items="@_items" Dense="true" Filterable="false">
	<Columns>
		<PropertyColumn Property="x => x.Name" Title="Subsystem"/>
		<PropertyColumn Property="x => x.Enabled" Title="Enabled"/>
		<PropertyColumn Property="x => x.Version" Title="Version"/>
	</Columns>
</MudDataGrid>

@code {
	IReadOnlyCollection<IPlugableComponent> _items;

	protected override string PageName => "Subsystems";

	protected override void OnInitialized() {
		base.OnInitialized();
		_items = PluginsService.PluggableComponents;
	}

}
